from django.utils.deprecation import MiddlewareMixin        # 导入django中间件扩展类
from django.middleware.csrf import get_token

class Middleware(MiddlewareMixin):
    def process_request(self, request):
        get_token(request)
